package com.woniu.dao;

import com.woniu.pojo.DynamicDetail;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface DynamicDetailMapper {
    int deleteByPrimaryKey(Long id);

    int insert(DynamicDetail record);

    int insertSelective(DynamicDetail record);

    DynamicDetail selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(DynamicDetail record);

    int updateByPrimaryKey(DynamicDetail record);
@Select("select dynamic_img from dynamic_detail where dynamic_id=${id}")
    List<String> selectImgByDynamicId(Long id);
@Delete("delete from dynamic_detail where dynamic_id=#{id}")
    void deleteDynamicImgs(Long id);
@Select("select user_id from dynamic_detail where dynamic_id=#{id}")
List<Long> selectUid(Long id);
    @Delete("delete from dynamic_tags where dynamic_id=#{dynamicId}")
    void deleteTag(Long dynamicId);
@Select("select like_num from dynamic where id=#{id}")
    Integer selectLikeNum(Long id);
@Update("update dynamic set like_num =#{num} where id=#{id}")
    void insertLikeNum(@Param("num") Integer num,@Param("id") Long id);
}